<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>Document</title>
	<link rel="stylesheet" href="./TPl/css/bootstrap.min.css">
	<style type="text/css">
	
	header{
		height: 100px;
		background: #333;
		color: #fff;
		font-size: 20px;
		line-height: 100px;
		margin-bottom: 20px;
	}
	#liu{
		float: right;
		margin-top: 25px
	}
	#lyb{
		width: 100px;
		height: 50px;
		float: left;
	}
	.liu{
		float: right;
	}
	</style>
	
</head>
<body>
<header>
<p id="lyb">留言板</p>
<?php if (isset($_SESSION['nikename'])) {?>
	<div class="form-group">
		<a href="./loginout.php" class="btn btn-success" id="liu">退出</a>
		<p class="btn btn-danger" id="liu"><?php echo $_SESSION['nikename']; ?></p>
	</div>
<?php }else{ ?>
	<form class="form-inline liu" method="post" action="./app1.php">
	 	 <div class="form-group">
	   	 <label for="exampleInputName2">账号</label>
	  	  <input type="text" class="form-control" id="exampleInputName2" name="username">
	 	 </div>
	 	 <div class="form-group">
	   	 <label for="exampleInputName2">密码</label>
	  	  <input type="text" class="form-control" id="exampleInputName2" name="possword">
	 	 </div>
  		<button type="submit" class="btn btn-default btn btn-info">登陆</button>
  		 <a class="btn btn-info" href="./dl.php" role='button'>注册</a>
	</form>
	<?php } ?>



	
</header>
<div class="col-md-12">
<?php foreach ($bd as $k => $v) {?>
	<div class="alert <?php echo $color[array_rand($color)]?>" role="alert">
      <strong>
      	<?php echo $v['username']; ?>
      </strong><?php echo $v['content']; ?><?php echo $v['email'] ?>(<?php echo date('Y-m-d H-i-s',$v['create_time']); ?>)
      <a class="btn btn-danger" href="./db.php?id=<?php echo $k; ?>" role='button'>删除</a>
       <a class="btn btn-info" href="./dei.php?id=<?php echo $k; ?>" role='button'>修改</a>
    </div>
<?php } ?>
 </div>
 <?php if (isset($_SESSION['nikename'])) {?>
 	<div class="col-md-12">
 	<form class="form-inline" method="post" action="./app.php">
	  <div class="form-group">
	    <label for="exampleInputName2">Name</label>
	    <input type="text" class="form-control" id="exampleInputName2" name="username" placeholder="Jane Doe">
	  </div>
	  <div class="form-group">
	    <label for="exampleInputEmail2">Email</label>
	    <input type="email" class="form-control" id="exampleInputEmail2" placeholder="jane.doe@example.com" name="email">
  </div>
  <button type="submit" class="btn btn-default btn btn-info">提交</button><br>
  <textarea class="form-control" rows="3" name="content"></textarea>
</form>
<?php }else{ ?>
	<div class="col-md-12">
 	<form class="form-inline" method="post" action="./app2.php">
	  <div class="form-group">
	    <label for="exampleInputName2">Name</label>
	    <input type="text" class="form-control" id="exampleInputName2" name="username" placeholder="Jane Doe">
	  </div>
	  <div class="form-group">
	    <label for="exampleInputEmail2">Email</label>
	    <input type="email" class="form-control" id="exampleInputEmail2" placeholder="jane.doe@example.com" name="email">
  </div>
  <button type="submit" class="btn btn-default btn btn-info">提交</button><br>
  <textarea class="form-control" rows="3" name="content"></textarea>
</form>
	<?php } ?>
 

 </div>
</body>
</html>